home *** CD-ROM | disk | FTP | other *** search
- //shader to clip any pixels with a Z coordinate below the water plane
- //modulates color from vertex with texture sample
- //must be used with clipZ_lit.vsh
- //Luke Lenhart
- //(C)2004-2005 Digipen Institute of Technology
-
- //base texture
- sampler2D sampTex;
-
- //shader input
- struct PS_INPUT
- {
- float4 Pos : TEXCOORD1;
- float2 Tex0 : TEXCOORD0;
- float4 Color : COLOR;
- };
-
- //shader
- float4 PShader(PS_INPUT In) : COLOR
- {
- //cut out pixel if it's below z=0
- clip(In.Pos.z);
-
- //sample texture and scale by color
- float4 clr=tex2D(sampTex,In.Tex0);
- clr*=In.Color;
-
- //
- return clr;
- };
-